import cv2

avi = 'C0002.avi'
videoCapture = cv2.VideoCapture(avi)
fps = videoCapture.get(cv2.CAP_PROP_FPS)
size = (int(videoCapture.get(cv2.CAP_PROP_FRAME_WIDTH)),int(videoCapture.get(cv2.CAP_PROP_FRAME_HEIGHT)))
print(fps,size)
videoWriter = cv2.VideoWriter('my.avi',cv2.VideoWriter_fourcc('X','V','I','D'),fps,size)
success,frame = videoCapture.read()
while success:
    videoWriter.write(frame)
    success,frame = videoCapture.read()